﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Role_PowerDetail :BasePage
{
    private int roleId;
    protected void Page_Load(object sender, EventArgs e)
    {
        roleId = Convert.ToInt32(Request.QueryString["roleid"]);
        if(!IsPostBack)
            BindData();
    }

    protected void BindData()
    {
        
        FreeHouse.BLL.TRole bllRole = new FreeHouse.BLL.TRole();
        //Action
        //判断权限
        if (UserPower.HaveAction((int)FreeHouse.Power.Actions.TRole.GetRoleAction))
        {
            action.DataSource = bllRole.GetRoleAction(roleId);
            action.DataBind();
        }
        //Fields
        //判断权限
        if (UserPower.HaveAction((int)FreeHouse.Power.Actions.TRole.GetRoleFields))
        {
            Fields.DataSource = bllRole.GetRoleFields(roleId);
            Fields.DataBind();
        }
        //role
        FreeHouse.Model.TRole aRole = new FreeHouse.BLL.TRole().GetModel(roleId);
        if (aRole != null)
        {
            roleName.Text = aRole.RoleName;
        }
    }
}
